package com.shanshi.activity;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

public class RechargeCash extends MainActivity{

	private SharedPreferences sharedPreferences;
	private String money;
	private TextView tv;
	private EditText et;
	private TextView recharge_restmoney;
	private ImageView recharge_zhifubao;
	private ImageView recharge_weixin;


	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.recharge);

		//获得余额
		sharedPreferences = RechargeCash.this.getSharedPreferences("share", MODE_PRIVATE);
		money = sharedPreferences.getString("money","0.00");

		tv = (TextView) findViewById(R.id.cancel);
		tv.setText("");

		et = (EditText) findViewById(R.id.recharge_money);
		et.setSelection(3);
		recharge_restmoney = (TextView) findViewById(R.id.recharge_restmoney);
		recharge_restmoney.setText("￥"+money);
		recharge_zhifubao = (ImageView) findViewById(R.id.recharge_zhifubao);
		recharge_weixin = (ImageView) findViewById(R.id.recharge_weixin);
	}

	public void nextStep(View view){
		switch (view.getId()){
			case R.id.recharge_cancel:
				finish();
				break;
			case R.id.recharge_5:
				et.setText("5");
				et.setSelection(1);
				break;
			case R.id.recharge_10:
				et.setText("10");
				et.setSelection(2);
				break;
			case R.id.recharge_20:
				et.setText("20");
				et.setSelection(2);
				break;
			case R.id.recharge_50:
				et.setText("50");
				et.setSelection(2);
				break;
			case R.id.recharge_200:
				et.setText("200");
				et.setSelection(3);
				break;
			case R.id.recharge_zhifubao:
				recharge_zhifubao.setImageResource(R.drawable.selected);
				recharge_weixin.setImageResource(R.drawable.unchecked);
				break;
			case R.id.recharge_weixin:
				recharge_zhifubao.setImageResource(R.drawable.unchecked);
				recharge_weixin.setImageResource(R.drawable.selected);
				break;
			case R.id.recharge_submit:
				//......
				break;
		}
	}
	

}
